import { IServiceManager } from "../../ioc/types";
import { IApplicationDiagnostics } from "../types";
import { ApplicationDiagnostics } from './applicationDiagnostics';
import { InvalidEQPathInDebuggerService, InvalidEQPathInDebuggerServiceId } from "./checks/invalidPythonPathInDebugger";
import { PowerShellActivationHackDiagnosticsService, PowerShellActivationHackDiagnosticsServiceId } from "./checks/powerShellActivation";
import { DiagnosticsCommandFactory } from "./commands/factory";
import { IDiagnosticsCommandFactory } from "./commands/types";
import { DiagnosticFilterService } from "./filter";
import { DiagnosticCommandPromptHandlerService, DiagnosticCommandPromptHandlerServiceId, MessageCommandPrompt } from "./promptHandler";
import { IDiagnosticFilterService, IDiagnosticHandlerService, IDiagnosticsService } from "./types";

export function registerTypes(serviceManager: IServiceManager): void {

    serviceManager.addSingleton<IDiagnosticsService>(
        IDiagnosticsService,
        PowerShellActivationHackDiagnosticsService,
        PowerShellActivationHackDiagnosticsServiceId,
    );

    serviceManager.addSingleton<IApplicationDiagnostics>(IApplicationDiagnostics, ApplicationDiagnostics);
    serviceManager.addSingleton<IDiagnosticFilterService>(IDiagnosticFilterService, DiagnosticFilterService);
    serviceManager.addSingleton<IDiagnosticHandlerService<MessageCommandPrompt>>(
        IDiagnosticHandlerService,
        DiagnosticCommandPromptHandlerService,
        DiagnosticCommandPromptHandlerServiceId,
    );
    serviceManager.addSingleton<IDiagnosticsService>(
        IDiagnosticsService,
        InvalidEQPathInDebuggerService,
        InvalidEQPathInDebuggerServiceId,
    );
    serviceManager.addSingleton<IDiagnosticsCommandFactory>(IDiagnosticsCommandFactory, DiagnosticsCommandFactory);
}

